
package com.cbwl.eoas.cms.model.sysconfig;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.util.StringUtils;

import com.cbwl.eoas.common.base.CommonBean;
import com.cbwl.eoas.common.cache.redis.RedisCache;
import com.cbwl.eoas.common.cache.redis.RedisKeyPrefix;
import com.cbwl.eoas.common.util.SpringContextUtil;


/**
 * 
 * <p>[描述信息：说明类的基本功能]</p>
 *
 * @author 虞云波 - yuyunbo@3856.cc
 * @version 1.0 Created on 2017年10月20日 下午5:23:55
 */
public class SysEmployeeDTO extends CommonBean {

	

	

	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -1043529891576566873L;
	private java.lang.Long id;
	@NotBlank @Length(max=128)
	private java.lang.String empName;
	@Length(max=150)
	private java.lang.String empAvatar;
	@Length(max=64)
	private java.lang.String empCardno;
	@Length(max=5)
	private java.lang.String empSex;
	
	
	private String empSexName;
	
	private java.util.Date empEntryTime;
	
	private java.util.Date empDimissionTime;
	@Length(max=64)
	private java.lang.String empPosition;
	
	private java.lang.Long empDepartment;
	@Length(max=256)
	private java.lang.String empJurisdictionDept;
	@Length(max=512)
	private java.lang.String empAddress;
	@NotBlank @Length(max=5)
	private java.lang.String empStatus;
	
	private java.lang.Long creater;
	
	private java.util.Date gmtCreate;
	
	private java.lang.Long modifier;
	
	private java.util.Date gmtModified;
	
	//所属部门名称
	private String departName;
	
	//职员状态
	private String empStatusName;
	
	
	//columns END
	
	public void setId(java.lang.Long value) {
		this.id = value;
	}
	
	public java.lang.Long getId() {
		return this.id;
	}
	
	public void setEmpName(java.lang.String value) {
		this.empName = value;
	}
	
	public java.lang.String getEmpName() {
		return this.empName;
	}
	
	public void setEmpAvatar(java.lang.String value) {
		this.empAvatar = value;
	}
	
	public java.lang.String getEmpAvatar() {
		return this.empAvatar;
	}
	
	public void setEmpCardno(java.lang.String value) {
		this.empCardno = value;
	}
	
	public java.lang.String getEmpCardno() {
		return this.empCardno;
	}
	
	public void setEmpSex(java.lang.String value) {
		this.empSex = value;
		if (!StringUtils.isEmpty(value)) {
			RedisCache<String, String> redisCache = (RedisCache<String, String>) SpringContextUtil.getBean("redisCache");
			String redisValue =  redisCache.getStr(RedisKeyPrefix.DIC_PREFIX+value);
			if (!StringUtils.isEmpty(redisValue)) {
				this.empSexName = redisValue;
			}
		}
	}
	
	public java.lang.String getEmpSex() {
		return this.empSex;
	}
	
	public void setEmpEntryTime(java.util.Date value) {
		this.empEntryTime = value;
	}
	
	public java.util.Date getEmpEntryTime() {
		return this.empEntryTime;
	}
	
	public void setEmpDimissionTime(java.util.Date value) {
		this.empDimissionTime = value;
	}
	
	public java.util.Date getEmpDimissionTime() {
		return this.empDimissionTime;
	}
	
	public void setEmpPosition(java.lang.String value) {
		this.empPosition = value;
	}
	
	public java.lang.String getEmpPosition() {
		return this.empPosition;
	}
	
	public void setEmpDepartment(java.lang.Long value) {
		this.empDepartment = value;
	}
	
	public java.lang.Long getEmpDepartment() {
		return this.empDepartment;
	}
	
	public void setEmpJurisdictionDept(java.lang.String value) {
		this.empJurisdictionDept = value;
	}
	
	public java.lang.String getEmpJurisdictionDept() {
		return this.empJurisdictionDept;
	}
	
	public void setEmpAddress(java.lang.String value) {
		this.empAddress = value;
	}
	
	public java.lang.String getEmpAddress() {
		return this.empAddress;
	}
	
	public void setEmpStatus(java.lang.String value) {
		this.empStatus = value;
		if (!StringUtils.isEmpty(value)) {
			RedisCache<String, String> redisCache = (RedisCache<String, String>) SpringContextUtil.getBean("redisCache");
			String redisValue =  redisCache.getStr(RedisKeyPrefix.DIC_PREFIX+value);
			if (!StringUtils.isEmpty(redisValue)) {
				this.empStatusName = redisValue;
			}
		}
	}
	
	public java.lang.String getEmpStatus() {
		return this.empStatus;
	}
	
	public void setCreater(java.lang.Long value) {
		this.creater = value;
	}
	
	public java.lang.Long getCreater() {
		return this.creater;
	}
	
	public void setGmtCreate(java.util.Date value) {
		this.gmtCreate = value;
	}
	
	public java.util.Date getGmtCreate() {
		return this.gmtCreate;
	}
	
	public void setModifier(java.lang.Long value) {
		this.modifier = value;
	}
	
	public java.lang.Long getModifier() {
		return this.modifier;
	}
	
	public void setGmtModified(java.util.Date value) {
		this.gmtModified = value;
	}
	
	public java.util.Date getGmtModified() {
		return this.gmtModified;
	}
	
	public String getDepartName() {
		return departName;
	}
	
	public void setDepartName(String departName) {
		this.departName = departName;
	}
	
	public String getEmpStatusName() {
		return empStatusName;
	}

	
	public void setEmpStatusName(String empStatusName) {
		this.empStatusName = empStatusName;
	}
	
	public String getEmpSexName() {
		return empSexName;
	}

	
	public void setEmpSexName(String empSexName) {
		this.empSexName = empSexName;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("EmpName",getEmpName())
			.append("EmpAvatar",getEmpAvatar())
			.append("EmpCardno",getEmpCardno())
			.append("EmpSex",getEmpSex())
			.append("EmpEntryTime",getEmpEntryTime())
			.append("EmpDimissionTime",getEmpDimissionTime())
			.append("EmpPosition",getEmpPosition())
			.append("EmpDepartment",getEmpDepartment())
			.append("EmpJurisdictionDept",getEmpJurisdictionDept())
			.append("EmpAddress",getEmpAddress())
			.append("EmpStatus",getEmpStatus())
			.append("Creater",getCreater())
			.append("GmtCreate",getGmtCreate())
			.append("Modifier",getModifier())
			.append("GmtModified",getGmtModified())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof SysEmployeeDTO == false){return false;}
		if(this == obj){return true;}
		SysEmployeeDTO other = (SysEmployeeDTO)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

